package com.buanalintas.sandals.pos.entities;

import com.buanalintas.bynga.entities.MasterUnit;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

@Entity
@Table(name = "pos_master_item_stock")
@NamedQueries({
    @NamedQuery(name = "PosMasterItemStock.findAll", query = "SELECT t FROM PosMasterItemStock t"),
    @NamedQuery(name = "PosMasterItemStock.findBySync", query = "SELECT t FROM PosMasterItemStock t WHERE t.sync = :sync"),
    @NamedQuery(name = "PosMasterItemStock.findByItemStockId", query = "SELECT t FROM PosMasterItemStock t WHERE t.itemStockId = :itemStockId"),
    @NamedQuery(name = "PosMasterItemStock.findByItemStockValue", query = "SELECT t FROM PosMasterItemStock t WHERE t.itemStockValue = :itemStockValue")})
public class PosMasterItemStock implements Serializable {

    private static final long serialVersionUID = 1L;
    @Column(name = "sync")
    private String sync;
    @Id
    @Basic(optional = false)
    @Column(name = "item_stock_id")
    private Integer itemStockId;
    @Column(name = "item_stock_value")
    private Integer itemStockValue;
    @JoinColumn(name = "item_stock_item_id", referencedColumnName = "item_id")
    @ManyToOne
    private PosMasterItem itemStockItemId;
    @JoinColumn(name = "item_stock_status_id", referencedColumnName = "status_id")
    @ManyToOne
    private PosMasterStatus itemStockStatusId;
    @JoinColumn(name = "item_stock_unit_id", referencedColumnName = "unit_id")
    @ManyToOne
    private MasterUnit itemStockUnitId;
    @JoinColumn(name = "item_stock_color_id", referencedColumnName = "color_id")
    @ManyToOne
    private PosMasterColor itemStockColorId;
    @JoinColumn(name = "item_stock_size_id", referencedColumnName = "size_id")
    @ManyToOne
    private PosMasterSize itemStockSizeId;

    public PosMasterItemStock() {
    }

    public PosMasterItemStock(Integer itemStockId) {
        this.itemStockId = itemStockId;
    }

    public String getSync() {
        return sync;
    }

    public void setSync(String sync) {
        this.sync = sync;
    }

    public Integer getItemStockId() {
        return itemStockId;
    }

    public void setItemStockId(Integer itemStockId) {
        this.itemStockId = itemStockId;
    }

    public Integer getItemStockValue() {
        return itemStockValue;
    }

    public void setItemStockValue(Integer itemStockValue) {
        this.itemStockValue = itemStockValue;
    }

    public PosMasterItem getItemStockItemId() {
        return itemStockItemId;
    }

    public void setItemStockItemId(PosMasterItem itemStockItemId) {
        this.itemStockItemId = itemStockItemId;
    }

    public PosMasterStatus getItemStockStatusId() {
        return itemStockStatusId;
    }

    public void setItemStockStatusId(PosMasterStatus itemStockStatusId) {
        this.itemStockStatusId = itemStockStatusId;
    }

    public MasterUnit getItemStockUnitId() {
        return itemStockUnitId;
    }

    public void setItemStockUnitId(MasterUnit itemStockUnitId) {
        this.itemStockUnitId = itemStockUnitId;
    }

    public PosMasterColor getItemStockColorId() {
        return itemStockColorId;
    }

    public void setItemStockColorId(PosMasterColor itemStockColorId) {
        this.itemStockColorId = itemStockColorId;
    }

    public PosMasterSize getItemStockSizeId() {
        return itemStockSizeId;
    }

    public void setItemStockSizeId(PosMasterSize itemStockSizeId) {
        this.itemStockSizeId = itemStockSizeId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (itemStockId != null ? itemStockId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        if (!(object instanceof PosMasterItemStock)) {
            return false;
        }
        PosMasterItemStock other = (PosMasterItemStock) object;
        if ((this.itemStockId == null && other.itemStockId != null) || (this.itemStockId != null && !this.itemStockId.equals(other.itemStockId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.buanalintas.sandals.pos.entities.PosMasterItemStock[itemStockId=" + itemStockId + "]";
    }
}
